package request

import (
	"gitcode.com/G-YT/iHealth25/server/model/common/request"
	"gitcode.com/G-YT/iHealth25/server/model/health"
	"gitcode.com/G-YT/iHealth25/server/model/hierarchy"
)

type FdJqSearch struct {
	health.FdJq
	request.PageInfo
}

type FdJqArticle struct {
	FdJqID           uint                        `json:"fd_jq_id" gorm:"column:fd_jq_id;"`
	ArticleID        uint                        `json:"article_id" gorm:"column:article_id;"`
	Type             string                      `json:"type" gorm:"column:type;"`
	SolarTerms       *health.FdJq                `json:"-" form:"-" gorm:"->;foreignKey:FdJqID;references:ID;"`    // 关联节气
	FdArticleAudio   *hierarchy.FdArticleAudio   `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;"` // 关联音频文章
	FdArticleVideo   *hierarchy.FdArticleVideo   `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;"` // 关联视频文章
	FdArticleGraphic *hierarchy.FdArticleGraphic `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;"` // 关联图文文章
}

type FdJqArticleReq struct {
	FdJqID   uint   `json:"fd_jq_id" gorm:"column:fd_jq_id;"`
	Graphics []uint `json:"graphic_id" gorm:"column:graphic_id;"`
	Audios   []uint `json:"audio_id" gorm:"column:audio_id;"`
	Videos   []uint `json:"video_id" gorm:"column:video_id;"`
}

func (FdJqArticle) TableName() string {
	return "fd_jq_article"
}
